﻿///////////////////////////////////////////////////////////////////////////////////////////////
// System.Text.Parsing - © 2012 Sebastien Pellizzari
// Released under the MIT License (http://www.opensource.org/licenses/mit-license.php)
///////////////////////////////////////////////////////////////////////////////////////////////

namespace System.Text.Parsing
{
    /// <summary>Represents the interface for the range of source data represented by a token.</summary>
    /// <typeparam name="TRange">The type that implements the interface.</typeparam>
    public interface IDataRange<TRange>
        where TRange : IDataRange<TRange>
    {
        /// <summary>Creates a new range object representing the merge of this range and specified one.</summary>
        /// <param name="other">The other range to merge with.</param>
        /// <param name="result">The new range object.</param>
        /// <remarks>The current object and <paramref name="other"/> object must remain unchanged during the operation.</remarks>
        void MergeWith(ref TRange other, out TRange result);
        /// <summary>Creates a new range that starts and ends at the end of this range.</summary>
        /// <param name="result">The new range object.</param>
        /// <remarks>The current object must remain unchanged during the operation.</remarks>
        void GetEndRange(out TRange result);
    }
}
